package com.yj.wisemoms.data;

import java.io.IOException;

import android.util.Log;

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yj.wisemoms.Base.Version;

public class versiondata {
	
	private static versiondata uniqueInstance;  
	
	private versiondata() {}  
	
	public static versiondata getInstance(){  
		if(uniqueInstance == null){  
			uniqueInstance = new versiondata();  
		}  
		return uniqueInstance;  
	}  
	
	ObjectMapper mapper = new ObjectMapper();
	
	public Version version = new Version();
	
	public void setVersion(String versionStr){
		
		Log.i("json","version parser");
		Log.i("json",versionStr);
		try {
			version = mapper.readValue(versionStr, Version.class);
		} catch (JsonParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (JsonMappingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public Version getVersion(){
		return version;
	}
}


